package com.sqfw.common.enums.knowledge;

import lombok.Getter;
/**
 * 查无/纠错类型
 * 0：查无；1纠错
 * */
public enum KlHasTypeEnum {

    CHECK_NONE("0", "查无"),
    ERROR_CORRECTION("1", "纠错"),
    ;

    @Getter
    private String key;
    @Getter
    private String desc;

    KlHasTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    /**
     * 根据key，查询描述
     * */
    public static KlHasTypeEnum by(String key) {
        KlHasTypeEnum[] enums = KlHasTypeEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (key.equals(enums[i].key) ) {
                return enums[i];
            }
        }
        return null;
    }

}
